package fr.gedos.ged.analyser.recognition.adapter.interfaces;

import java.awt.Rectangle;
import java.io.File;
import java.io.IOException;
import java.util.List;

import fr.gedos.ged.analyser.recognition.adapter.exceptions.PictureNotWellWritingException;


/**
 * 
 * @author rastafire
 * 
 */
public interface OCRRecognitionModule {
    /**
     * Will prepare a sub picture(clean and extract).
     * 
     * @param area
     *            - The position of the sub picture
     * @return - The created File, contains the sub picture
     * @throws PictureNotWellWritingException
     * @throws IOException
     */
    public File prepareSubPicture(Rectangle area) throws IOException,
            PictureNotWellWritingException;

    /**
     * Will launch all OCR Recognition process.
     * 
     * @param fileToExtractWords
     *            - The picture file on which launch OCR
     * @return - The list of string extracted on different sub pictures
     * @throws PictureNotWellWritingException
     * @throws IOException
     * @throws InterruptedException
     */
    public List<String> launchOCR(File fileToExtractWords) throws IOException,
            PictureNotWellWritingException, InterruptedException;

    /**
     * Will define areas to extract.
     * 
     * @param areasToAnalyse
     *            - Rectangle which define sub pictures to extract
     */
    public void setAreasToAnalyse(List<Rectangle> areasToAnalyse);
}
